/**
 * @author Created by chenxin34 on 2019/12/23 下午5:06.
 */
public class StringBuilderTest {
    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder(1024);
        sb.setLength(2);
        sb.append("XXXXXXXXXXXXXXXXXXX");

        sb.setLength(0);
        sb.append("YYYY");

        System.out.println(sb.toString());
        System.out.println("end");
        System.out.println(sb.length());
        //真正释放
        sb.trimToSize();
    }
}
